﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:PresentationOptions="http://schemas.microsoft.com/winfx/2006/xaml/presentation/options"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:props="clr-namespace:ScrumFactory.Windows.Properties"
                    xmlns:SF_WpfUtils="clr-namespace:ScrumFactory.Composition.WpfUtils;assembly=ScrumFactory.Composition"
                    xmlns:sys="clr-namespace:System;assembly=mscorlib">


    <!-- FONT SIZES -->
    <sys:Double x:Key="SmallFontSize">12</sys:Double>
    <sys:Double x:Key="NormalFontSize">14</sys:Double>
    <sys:Double x:Key="BigFontSize">15</sys:Double>
    <sys:Double x:Key="MuchBiggerFontSize">16</sys:Double>
    <sys:Double x:Key="ReallyBigFontSize">20</sys:Double>
    
    <Style TargetType="{x:Type TextBlock}">
        <Setter Property="FontFamily" Value="Segoe UI"/>
        <Setter Property="FontSize" Value="{StaticResource NormalFontSize}"/>
    </Style>

    <Style TargetType="{x:Type Hyperlink}">
        <Setter Property="FontFamily" Value="Segoe UI"/>
        <Setter Property="FontSize" Value="{StaticResource NormalFontSize}"/>
        <Setter Property="Foreground" Value="{StaticResource LinkBrush}"/>
    </Style>

    <Style x:Key="MouseOverBorder" TargetType="{x:Type Border}">
        <Setter Property="Cursor" Value="Hand"/>
        <Setter Property="CornerRadius" Value="4"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="BorderBrush" Value="Transparent"/>
        <Style.Triggers>
            <Trigger Property="Border.IsMouseOver" Value="True">
                <Setter Property="Border.Background" Value="{StaticResource MouseOverBackgroundBrush}"/>
                <Setter Property="Border.BorderBrush" Value="{StaticResource MouseOverBorderBrush}"/>
                <Setter Property="TextBlock.Foreground" Value="{StaticResource MouseOverForegroundBrush}"/>
            </Trigger>
        </Style.Triggers>
    </Style>

    
    <Style x:Key="DockPanelTabControl"  TargetType="{x:Type TabControl}">        
        <Setter Property="Background" Value="{StaticResource DockPanelLeftBackground}"/>
        <Setter Property="IsTabStop" Value="False"/>
        <Setter Property="Padding" Value="0"/>
        <Setter Property="ItemContainerStyle">
            <Setter.Value>
                <Style TargetType="TabItem">                    
                    <Setter Property="Content">
                        <Setter.Value>                            
                                <ContentPresenter Content="{Binding View}">
                                    <ContentPresenter.Style>
                                        <Style>
                                            <Style.Triggers>
                                                <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType={x:Type TabControl}}, Path=SelectedItem}" Value="{x:Null}">
                                                    <Setter Property="ContentPresenter.Visibility" Value="Collapsed"/>
                                                </DataTrigger>
                                            </Style.Triggers>
                                        </Style>
                                    </ContentPresenter.Style>
                                </ContentPresenter>
                                
                        </Setter.Value>
                    </Setter>
                    <Setter Property="Header" Value="{Binding PanelName}"/>                                       
                    <Setter Property="Template">
                        <Setter.Value>
                            <ControlTemplate TargetType="{x:Type TabItem}">
                                <ControlTemplate.Resources>
                                    <Style TargetType="{x:Type ToggleButton}">
                                        <Setter Property="IsTabStop" Value="False"/>
                                        <Setter Property="Template">
                                            <Setter.Value>
                                                <ControlTemplate TargetType="{x:Type ToggleButton}">
                                                    <Border x:Name="border" Padding="5,3,5,5" CornerRadius="6,6,0,0" Cursor="Hand" BorderThickness="0" >
                                                        <ContentPresenter x:Name="contentPresenter">
                                                            <ContentPresenter.Resources>
                                                                <Style TargetType="TextBlock">
                                                                    <Setter Property="FontSize" Value="{StaticResource MuchBiggerFontSize}"/>
                                                                </Style>
                                                            </ContentPresenter.Resources>
                                                        </ContentPresenter>
                                                        <Border.Style>
                                                            <Style>
                                                                <Setter Property="Border.BorderBrush" Value="Transparent"/>
                                                                <Style.Triggers>
                                                                    <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType={x:Type TabItem}}, Path=DataContext.Dock}" Value="Left">
                                                                        <Setter Property="Border.LayoutTransform">
                                                                            <Setter.Value>
                                                                                <RotateTransform Angle="90" />
                                                                            </Setter.Value>
                                                                        </Setter>
                                                                    </DataTrigger>
                                                                </Style.Triggers>
                                                            </Style>
                                                        </Border.Style>
                                                    </Border>
                                                    <ControlTemplate.Triggers>
                                                        <Trigger Property="IsChecked" Value="True">
                                                            <Setter TargetName="contentPresenter" Property="TextBlock.Foreground"  Value="{StaticResource DockPanelSelectedTabItemForeground}"/>
                                                        </Trigger>
                                                        <Trigger Property="IsChecked" Value="False">
                                                            <Setter TargetName="contentPresenter" Property="TextBlock.Foreground"  Value="{StaticResource DockPanelTabItemForeground}"/>
                                                        </Trigger>
                                                        <Trigger Property="IsMouseOver" Value="True">
                                                            <Setter TargetName="border" Property="Background">
                                                                <Setter.Value>
                                                                    <SolidColorBrush Color="Black" Opacity="0.1"/>
                                                                </Setter.Value>
                                                            </Setter>
                                                        </Trigger>
                                                    </ControlTemplate.Triggers>
                                                </ControlTemplate>
                                            </Setter.Value>
                                        </Setter>
                                    </Style>
                                </ControlTemplate.Resources>
                                <ToggleButton                                    
                                    Content="{TemplateBinding Header}"                                    
                                    IsChecked="{Binding RelativeSource={RelativeSource AncestorType={x:Type TabItem}}, Path=IsSelected}"/>                                                                            
                            </ControlTemplate>
                        </Setter.Value>
                    </Setter>
                </Style>
            </Setter.Value>
        </Setter>          
    </Style>


    <Style TargetType="{x:Type TabControl}">        
        <Setter Property="Padding" Value="0"/>
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="BorderBrush" Value="{StaticResource TabControlBorderBrush}"/>
        <Setter Property="BorderThickness" Value="0,3,0,0"/>
        <Setter Property="ItemContainerStyle">
            <Setter.Value>
                <Style TargetType="TabItem">                   
                    <Setter Property="Template">
                        <Setter.Value>
                            <ControlTemplate  TargetType="{x:Type TabItem}">                            
                                <Grid>
                                    <ContentPresenter ContentSource="Header" Margin="5,0,5,3" Cursor="Hand">
                                        <ContentPresenter.Resources>
                                            <Style TargetType="{x:Type TextBlock}">
                                                <Setter Property="FontSize" Value="{StaticResource NormalFontSize}"/>
                                                <Setter Property="Foreground" Value="{StaticResource TabItemBrush}"/>
                                                <!--<Style.Triggers>
                                                <Trigger Property="TextBlock.IsMouseOver" Value="True">                                                    
                                                </Trigger>
                                            </Style.Triggers>-->
                                            </Style>
                                        </ContentPresenter.Resources>
                                    </ContentPresenter>
                                    <Polygon
                                        PresentationOptions:Freeze="True"
                                        Name="arrow"
                                         Fill="{StaticResource TabControlBorderBrush}"
                                         Points="5,0 10,5 0,5"
                                         HorizontalAlignment="Center" VerticalAlignment="Bottom"
                                         StrokeThickness="1"                                         
                                         Margin="0,0,0,0"/>
                                </Grid>       
                                <ControlTemplate.Triggers>
                                    <Trigger Property="IsSelected" Value="False">
                                        <Setter TargetName="arrow" Property="Path.Visibility" Value="Collapsed"/>
                                    </Trigger>
                                </ControlTemplate.Triggers>
                            </ControlTemplate>
                        </Setter.Value>
                    </Setter>
                </Style>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="{x:Type ListBoxItem}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ListBoxItem">                    
                        <Border Style="{StaticResource MouseOverBorder}" Padding="3">
                          <ContentPresenter x:Name="content" />
                        </Border>                    
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="HorizontalLineDividedListBoxItem" TargetType="{x:Type ListBoxItem}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ListBoxItem">
                    <Border BorderThickness="0,0,0,1" Padding="3" BorderBrush="{StaticResource ItemDivisonLineBrush}">
                        <Border Style="{StaticResource MouseOverBorder}">
                            <ContentPresenter x:Name="content" />
                        </Border>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="LoadingAnimationContent" TargetType="{x:Type ContentControl}">
        <Setter Property="Visibility" Value="Collapsed"/>
        <Setter Property="Template">            
            <Setter.Value>
                <ControlTemplate>
                    <StackPanel>
                        <StackPanel.Background>
                            <SolidColorBrush Color="LightGray" Opacity="0.1" PresentationOptions:Freeze="True"  />
                        </StackPanel.Background>
                        <Image
                            Source="/Images/LogoLoading.png"                
                            Stretch="None"
                            HorizontalAlignment="Center"
                            VerticalAlignment="Center"
                            Margin="5,5,5,0">
                            <Image.RenderTransform>
                                <ScaleTransform ScaleX="1" ScaleY="1" CenterX="0.5" CenterY="0.5"/>
                            </Image.RenderTransform>
                            <Image.Triggers>
                                <EventTrigger RoutedEvent="Image.Loaded">
                                    <EventTrigger.Actions>
                                        <BeginStoryboard>
                                            <Storyboard AutoReverse="True" RepeatBehavior="Forever" >
                                                <DoubleAnimation                                                                        
                                                Storyboard.TargetProperty="(Image.RenderTransform).(ScaleTransform.ScaleX)"                                               
                                                To="0.8"
                                                Duration="00:00:0.5"
                                                PresentationOptions:Freeze="True"/>
                                                <DoubleAnimation Storyboard.TargetProperty="(Image.RenderTransform).(ScaleTransform.ScaleY)"
                                                To="0.8"
                                                Duration="00:00:0.5"
                                                PresentationOptions:Freeze="True"/>
                                            </Storyboard>
                                        </BeginStoryboard>
                                    </EventTrigger.Actions>
                                </EventTrigger>
                            </Image.Triggers>
                        </Image>
                        <TextBlock Text="{x:Static props:Resources.Loading}" FontSize="{StaticResource SmallFontSize}" Foreground="LightGray" HorizontalAlignment="Center"/>
                    </StackPanel>
                </ControlTemplate>
            
            </Setter.Value>
        </Setter>
        <Style.Triggers>
            <DataTrigger Binding="{Binding IsLoadingData}" Value="True">
                <Setter Property="Visibility" Value="Visible"/>
            </DataTrigger>
        </Style.Triggers>
    </Style>
    
    <Style TargetType="TextBox">
        <Setter Property="FontFamily" Value="Segoe UI"/>
        <Setter Property="FontSize" Value="{StaticResource BigFontSize}"/>
        <Setter Property="BorderBrush" Value="{StaticResource TextBoxBorderBrush}"/>
        <Setter Property="Background" Value="{StaticResource TextBoxBackgroundBrush}"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type TextBoxBase}">
                    <Border                             
                        Name="Border"
                        CornerRadius="3" 
                        Margin="3"
                        Padding="2"         
                        Background="{StaticResource TextBoxBackgroundBrush}"
                        BorderBrush="{TemplateBinding BorderBrush}"
                        BorderThickness="{TemplateBinding BorderThickness}" >
                        <Grid>
                            <TextBlock                                                     
                                    x:Name="tooltipTextBlock"
                                    VerticalAlignment="Center"
                                    Text="{TemplateBinding ToolTip}" FontStyle="Italic" Foreground="LightGray">
                                <TextBlock.Style>
                                    <Style>
                                        <Setter Property="TextBlock.Visibility" Value="Collapsed"/>    
                                    </Style>                                                
                                </TextBlock.Style>
                            </TextBlock>
                            <ScrollViewer Margin="0" x:Name="PART_ContentHost"
                                      TextBlock.FontFamily="{TemplateBinding FontFamily}"
                                      TextBlock.FontSize="{TemplateBinding TextBox.FontSize}"/>
                        </Grid>                        
                    </Border>
                    <ControlTemplate.Triggers>                        
                        <MultiTrigger>
                            <MultiTrigger.Conditions>
                                <Condition Property="TextBox.IsKeyboardFocusWithin" Value="False"/>
                                <Condition Property="TextBox.Text" Value=""/>
                            </MultiTrigger.Conditions>
                            <Setter TargetName="tooltipTextBlock" Property="TextBlock.Visibility" Value="Visible"/>
                        </MultiTrigger>
                        <Trigger Property="ToolTip" Value="{x:Null}">
                            <Setter TargetName="tooltipTextBlock" Property="TextBlock.Visibility" Value="Collapsed"/>
                        </Trigger>
                        <Trigger Property="IsMouseOver" Value="True">                            
                            <Setter Property="BorderBrush" Value="{StaticResource TextBoxBorderOverBrush}"/>                            
                        </Trigger>
                        <Trigger Property="IsReadOnly" Value="True">
                            <Setter TargetName="Border" Property="Background" Value="Transparent"/>
                            <Setter Property="Background" Value="Transparent"/>
                            <Setter Property="BorderBrush" Value="Transparent"/>                            
                            <Setter Property="Foreground" Value="Black"/>
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter TargetName="Border" Property="Background" Value="LightGray"/>                            
                            <Setter Property="Foreground" Value="Black"/>
                        </Trigger>
                        <Trigger Property="IsFocused" Value="True">
                            <Setter Property="BorderBrush" Value="{StaticResource TextBoxBorderOverBrush}"/>
                        </Trigger>
                      

                    </ControlTemplate.Triggers>

                </ControlTemplate>
            </Setter.Value>
        </Setter>

    </Style>


    <Style x:Key="SearchTextBox" TargetType="TextBox" BasedOn="{StaticResource {x:Type TextBox}}">
        <Style.Triggers>
            <Trigger Property="IsFocused" Value="True">
                <Setter Property="BorderBrush" Value="{StaticResource TextBoxBorderOverBrush}"/>
                <Setter Property="Background" Value="{StaticResource SearchTextBoxBackgroundBrush}"/>
            </Trigger>
        </Style.Triggers>
    </Style>

    <Style x:Key="LabelTextBlock" TargetType="{x:Type TextBlock}" BasedOn="{StaticResource {x:Type TextBlock}}">
        <Setter Property="Foreground" Value="{StaticResource LabelBrush}"/>
        <Setter Property="Margin" Value="3"/>
        <Setter Property="VerticalAlignment" Value="Center"/>        
    </Style>


    <Style TargetType="ComboBoxItem">
        <Setter Property="Template">
            <Setter.Value>                                
                    <ControlTemplate TargetType="ComboBoxItem">
                        <Border Style="{StaticResource MouseOverBorder}" Padding="2" >
                            <ContentPresenter x:Name="content" />
                         </Border>
                    </ControlTemplate>                
            </Setter.Value>
        </Setter>
    </Style>



    <ControlTemplate x:Key="ComboBoxToggleButton" TargetType="{x:Type ToggleButton}">
            <Grid HorizontalAlignment="Stretch" Cursor="Hand">                                
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="Auto"/>
            </Grid.ColumnDefinitions>
            <ContentPresenter Grid.Column="0" Margin="4" />
            <Border Grid.Column="1" CornerRadius="3" Background="Transparent" IsHitTestVisible="True" >                
                <Grid Margin="2,0,2,0">
                    <Ellipse                        
                        Width="20"
                        Height="20"
                        Stroke="{StaticResource ComboBoxToggleBrush}"
                        Fill="{StaticResource ComboBoxToggleBackground}"/>
                    <Ellipse
                        x:Name="overEllipse"
                        Width="20"
                        Height="20"
                        Opacity="0.5"
                        Fill="White"/>
                    <Path                              
                    x:Name="Arrow"                
                    Fill="{StaticResource ComboBoxToggleBrush}"
                    HorizontalAlignment="Center"
                    VerticalAlignment="Center"
                    Margin="5,0,5,0"
                    Data="M 0 0 L 4 4 L 8 0 Z"/>
                </Grid>                
            </Border>            
        </Grid>
        <ControlTemplate.Triggers>
            <Trigger Property="IsMouseOver" Value="True">
                <Setter TargetName="overEllipse" Property="Visibility" Value="Visible"/>
            </Trigger>
            <Trigger Property="IsMouseOver" Value="False">
                <Setter TargetName="overEllipse" Property="Visibility" Value="Collapsed"/>
            </Trigger>
        </ControlTemplate.Triggers>
        </ControlTemplate>
    




        <Style TargetType="{x:Type ComboBox}">        
        <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/>
        <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
        <Setter Property="ScrollViewer.CanContentScroll" Value="true"/>
        <Setter Property="BorderBrush" Value="{StaticResource TextBoxBorderBrush}"/>
        <Setter Property="Foreground" Value="{StaticResource LabelBrush}"/>
        <Setter Property="Background" Value="{StaticResource TextBoxBackgroundBrush}"/>        
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ComboBox}">
                    <Border
                        Margin="3"                                                
                        CornerRadius="3"
                        Background="{TemplateBinding Background}"
                        BorderBrush="{TemplateBinding BorderBrush}"
                        BorderThickness="{TemplateBinding BorderThickness}">
                        <Grid>

                            <ToggleButton 
                                HorizontalAlignment="Stretch" 
                                Style="{x:Null}"
                                Name="ToggleButton"                                                         
                                Focusable="False"                                                       
                                Template="{StaticResource ComboBoxToggleButton}"
                                IsChecked="{Binding Path=IsDropDownOpen,Mode=TwoWay,RelativeSource={RelativeSource TemplatedParent}}">
                                
                                    <ContentPresenter                            
                                        Grid.Column="0"
                                        Name="ContentSite"                                                                    
                                        IsHitTestVisible="True"                            
                                        Content="{TemplateBinding SelectionBoxItem}"                            
                                        ContentTemplateSelector="{TemplateBinding ItemTemplateSelector}"                                                    
                                        VerticalAlignment="Center"
                                        HorizontalAlignment="Stretch">
                                        <ContentPresenter.Resources>
                                            <Style TargetType="{x:Type TextBlock}">
                                            <Setter Property="FontSize" Value="{StaticResource BigFontSize}"/>
                                            </Style>
                                        </ContentPresenter.Resources>
                                    </ContentPresenter>

                                    
                                
                            </ToggleButton>
                            

                            <TextBox x:Name="PART_EditableTextBox"                            
                            HorizontalAlignment="Left"                             
                            Focusable="True"                             
                            Visibility="Collapsed"
                            IsReadOnly="{TemplateBinding IsReadOnly}"/>
                            <Popup 
                            Name="Popup"                            
                            VerticalOffset="-2"
                            Placement="Bottom"                            
                            IsOpen="{TemplateBinding IsDropDownOpen}"
                            AllowsTransparency="True" 
                            Focusable="False"                            
                            PopupAnimation="Slide">
                                <StackPanel Orientation="Vertical" Margin="0,0,5,5">
                                    <Polygon
                                        PresentationOptions:Freeze="True"
                                        Fill="{StaticResource ComboBoxBorderBrush}"
                                         Points="11,0 21,5 0,5"
                                         HorizontalAlignment="Center"
                                         StrokeThickness="1"
                                         VerticalAlignment="Top"
                                         Margin="0,0,0,0"/>
                                    <Grid 
                                  Name="DropDown"
                                  Margin="0,-2,0,0"
                                  SnapsToDevicePixels="True"                
                                  MinWidth="{TemplateBinding ActualWidth}"
                                  MaxHeight="{TemplateBinding MaxDropDownHeight}">
                                        <Border 
                                    x:Name="DropDownBorder"                                    
                                        Background="{StaticResource ComboBoxDropDownBackground}"
                                    BorderThickness="1,2,1,2"
                                        BorderBrush="{StaticResource ComboBoxBorderBrush}"
                                    >

                                            <ScrollViewer Margin="4,6,4,6" SnapsToDevicePixels="True" HorizontalScrollBarVisibility="Disabled">
                                                <ItemsPresenter                                                    
                                                    SnapsToDevicePixels="{TemplateBinding UIElement.SnapsToDevicePixels}" KeyboardNavigation.DirectionalNavigation="Contained" />
                                            </ScrollViewer>
                                            <Border.Effect>
                                                <DropShadowEffect Opacity="0.5" ShadowDepth="3" />
                                            </Border.Effect>
                                        </Border>
                                    </Grid>
                                </StackPanel>

                            </Popup>
                        </Grid>
                    </Border>
             

                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter Property="BorderBrush" Value="{StaticResource TextBoxBorderOverBrush}"/>
                        </Trigger>
                        <Trigger Property="HasItems" Value="false">
                            <Setter TargetName="DropDownBorder" Property="MinHeight" Value="95"/>
                        </Trigger>
                        <Trigger Property="IsGrouping" Value="true">
                            <Setter Property="ScrollViewer.CanContentScroll" Value="false"/>
                        </Trigger>
                        <Trigger SourceName="Popup" Property="Popup.AllowsTransparency" Value="true">
                            <Setter TargetName="DropDownBorder" Property="CornerRadius" Value="4"/>
                            <Setter TargetName="DropDownBorder" Property="Margin" Value="0,2,0,0"/>
                        </Trigger>
                        <Trigger Property="IsEditable" Value="true">
                            <Setter Property="IsTabStop" Value="False"/>
                            <Setter TargetName="PART_EditableTextBox" Property="Visibility"    Value="Visible"/>
                            <!--<Setter TargetName="ContentSite" Property="Visibility" Value="Hidden"/>-->
                        </Trigger>
                        <Trigger Property="IsReadOnly" Value="True">
                            <Setter Property="IsTabStop" Value="False"/>
                            
                            <Setter TargetName="ToggleButton" Property="IsEnabled" Value="False"/>
                        </Trigger>

                    </ControlTemplate.Triggers>

                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <!--<Style.Triggers>            
                    <Trigger Property="IsReadOnly" Value="True">
                        <Setter Property="IsEnabled" Value="False"/>
                    </Trigger>            
        </Style.Triggers>-->

    </Style>

    <Style x:Key="ContentPanelBorder" TargetType="{x:Type Border}">
        <Setter Property="Background">
            <Setter.Value>
                <LinearGradientBrush StartPoint="0,0" EndPoint="0,1500" MappingMode="Absolute" PresentationOptions:Freeze="True">
                    <GradientStop Color="{StaticResource Blue0Color}" Offset="0"/>
                    <GradientStop Color="White" Offset="0.07"  />                    
                </LinearGradientBrush>
            </Setter.Value>
        </Setter>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="BorderBrush">
            <Setter.Value>
                <LinearGradientBrush StartPoint="0,0" EndPoint="0,1" PresentationOptions:Freeze="True">
                    <GradientStop Color="Gray" Offset="0"/>
                    <GradientStop Color="White" Offset="1"  />
                </LinearGradientBrush>
            </Setter.Value>
        </Setter>
        <Setter Property="CornerRadius" Value="5,5,0,0"/>
    </Style>

    <!-- TOOL BAR-->
    <Style TargetType="{x:Type ToolBar}">                
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="ToolBarTray.IsLocked" Value="True"/>
        <Setter Property="Padding" Value="2"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ToolBar}">
                    <Border x:Name="Border" 
                            Background="{TemplateBinding Background}"
                            Margin="0,0,0,0" Padding="{TemplateBinding Padding}"  BorderThickness="0"  HorizontalAlignment="{TemplateBinding HorizontalAlignment}">
                        <DockPanel>
                            <ToggleButton                                
                                x:Name="moreButton"
                                Visibility="Collapsed"
                                DockPanel.Dock="Right"
                                IsEnabled="{TemplateBinding HasOverflowItems}"
                                
                                IsChecked="{Binding Path=IsOverflowOpen,Mode=TwoWay,RelativeSource={RelativeSource TemplatedParent}}"
                                ClickMode="Press">
                                <Popup x:Name="OverflowPopup"
                                    AllowsTransparency="true"
                                    Placement="Bottom"
                                    IsOpen="{Binding Path=IsOverflowOpen,RelativeSource={RelativeSource TemplatedParent}}"
                                    StaysOpen="false"
                                    Focusable="false"
                                    PopupAnimation="Slide">
                                    <Border x:Name="DropDownBorder"
                                      Background="{TemplateBinding Background}"
                                      BorderThickness="1"
                                      BorderBrush="{TemplateBinding BorderBrush}">
                                        <ToolBarOverflowPanel x:Name="PART_ToolBarOverflowPanel"
                                            Margin="2"
                                            WrapWidth="200"
                                            Focusable="true" 
                                            FocusVisualStyle="{x:Null}"
                                            KeyboardNavigation.TabNavigation="Cycle"
                                            KeyboardNavigation.DirectionalNavigation="Cycle"/>
                                    </Border>
                                </Popup>
                            </ToggleButton>
                            <ToolBarPanel                                
                                x:Name="PART_ToolBarPanel"                                          
                                IsItemsHost="true"/>
                        </DockPanel>
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="HasOverflowItems" Value="true">
                            <Setter TargetName="moreButton" Property="Visibility" Value="Visible"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                    <ControlTemplate.Resources>
                        
                        <Style TargetType="{x:Type Border}">
                            <Setter Property="CornerRadius" Value="5"/>
                            <Setter Property="Background">
                                <Setter.Value>
                                    <SolidColorBrush Color="{StaticResource Blue0Color}" Opacity="0.3"/>
                                </Setter.Value>
                            </Setter>
                        </Style>
                        
                        <ControlTemplate x:Key="ToolBarMenu_SubMenuItem" TargetType="{x:Type MenuItem}">
                            <Border x:Name="border" Style="{StaticResource MouseOverBorder}" MinWidth="60">
                                <StackPanel Orientation="Vertical" Cursor="Hand" >
                                    <ContentPresenter ContentSource="Icon" Margin="0,0,0,0" HorizontalAlignment="Center" />
                                    <ContentPresenter ContentSource="Header" RecognizesAccessKey="True" HorizontalAlignment="Center">
                                        <ContentPresenter.Resources>
                                            <Style TargetType="{x:Type TextBlock}">
                                                <Setter Property="FontSize" Value="{StaticResource SmallFontSize}"/>
                                                <Setter Property="Foreground" Value="{StaticResource ToolBarItemBrush}"/>
                                            </Style>
                                        </ContentPresenter.Resources>
                                    </ContentPresenter>
                                </StackPanel>
                            </Border>
                            <ControlTemplate.Triggers>
                                <Trigger Property="IsEnabled" Value="False">
                                    <Setter TargetName="border" Property="Opacity" Value="0.5"/>
                                </Trigger>
                            </ControlTemplate.Triggers>
                        </ControlTemplate>

                      
                        <Style TargetType="{x:Type MenuItem}">                                                  
                             <Setter Property="Template" Value="{StaticResource ToolBarMenu_SubMenuItem}"/>                      
                        </Style>

                    </ControlTemplate.Resources>
                </ControlTemplate>
            </Setter.Value>
        </Setter>

    </Style>
 
    <Style TargetType="{x:Type ListView}">
        <Setter Property="OverridesDefaultStyle" Value="true"/>
        <Setter Property="AlternationCount" Value="2"/>
        <Setter Property="ItemContainerStyle">
            <Setter.Value>               
                <Style TargetType="{x:Type ListViewItem}">
                    <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
                    <Setter Property="Template">
                        <Setter.Value>
                            <ControlTemplate TargetType="ListViewItem">
                                <Border Background="{TemplateBinding Background}" BorderThickness="0,0,0,1" Padding="3" BorderBrush="{StaticResource ItemDivisonLineBrush}">                                
                                    <!--<Border Style="{StaticResource MouseOverBorder}" x:Name="border">-->
                                        <GridViewRowPresenter  />
                                    <!--</Border>-->
                                </Border>                                
                            </ControlTemplate>
                        </Setter.Value>
                    </Setter>
                    <Style.Triggers>
                        <Trigger Property="ItemsControl.AlternationIndex" Value="0">
                            <Setter Property="Background" Value="Transparent"/>
                        </Trigger>
                        <Trigger Property="ItemsControl.AlternationIndex" Value="1">
                            <Setter Property="Background" Value="{StaticResource AlternateRowBackgroundBrush}"/>
                        </Trigger>
                    </Style.Triggers>
                </Style>
            </Setter.Value>
        </Setter>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ListView}">                    
                        <StackPanel>
                        <Border Background="{StaticResource GridHeaderBackground}" CornerRadius="5,5,5,5" Padding="2">
                            <GridViewHeaderRowPresenter
                                    Columns="{Binding Path=View.Columns, RelativeSource={RelativeSource TemplatedParent}}"
                                    ColumnHeaderContainerStyle="{Binding Path=View.ColumnHeaderContainerStyle,
                                    RelativeSource={RelativeSource TemplatedParent}}"
                                    ColumnHeaderTemplate="{Binding Path=View.ColumnHeaderTemplate, RelativeSource={RelativeSource TemplatedParent}}"
                                    ColumnHeaderTemplateSelector="{Binding Path=View.ColumnHeaderTemplateSelector, RelativeSource={RelativeSource TemplatedParent}}"
                                    AllowsColumnReorder="{Binding Path=View.AllowsColumnReorder, RelativeSource={RelativeSource TemplatedParent}}"
                                    ColumnHeaderContextMenu="{Binding Path=View.ColumnHeaderContextMenu, RelativeSource={RelativeSource TemplatedParent}}"
                                    ColumnHeaderToolTip="{Binding Path=View.ColumnHeaderToolTip, RelativeSource={RelativeSource TemplatedParent}}"
                                    SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
                        </Border>
                        <ItemsPresenter  />
                        </StackPanel>                    
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>



    <Style TargetType="{x:Type GridViewColumnHeader}">
        <Setter Property="HorizontalContentAlignment" Value="Left"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="BorderThickness" Value="0"/>
        <Setter Property="Padding" Value="0"/>
        <Setter Property="Foreground" Value="{StaticResource GridHeaderForeground}"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type GridViewColumnHeader}">
                    <Grid SnapsToDevicePixels="true"
                          Background="{TemplateBinding Background}">
                        <Border BorderThickness="{TemplateBinding BorderThickness}"
                                BorderBrush="{TemplateBinding BorderBrush}"
                                Padding="{TemplateBinding Padding}"
                                Margin="1,0,1,0">
                            <ContentPresenter x:Name="HeaderContent"
                                              Margin="5,0,0,1"
                                              VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                              HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                              RecognizesAccessKey="True"
                                              SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}">
                                <ContentPresenter.Resources>
                                    <Style TargetType="{x:Type TextBlock}">
                                        <Setter Property="FontSize" Value="{StaticResource SmallFontSize}"/>                                        
                                    </Style>
                                </ContentPresenter.Resources>
                            </ContentPresenter>
                        </Border>
                        <Thumb
                                x:Name="PART_HeaderGripper"
                                HorizontalAlignment="Right"
                                Margin="0"
                                Width="2" >
                            <Thumb.Style>
                                <Style TargetType="Thumb">
                                    <Setter Property="Template">
                                        <Setter.Value>
                                            <ControlTemplate TargetType="{x:Type Thumb}">
                                                <Border Width="3" Background="Transparent"/>
                                            </ControlTemplate>
                                        </Setter.Value>
                                    </Setter>
                                </Style>
                            </Thumb.Style>
                        </Thumb>

                    </Grid>
                    <!--<ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="true">
                            <Setter TargetName="PART_HeaderGripper" Property="Background" Value="Transparent"/>
                            <Setter Property="Background" Value="#FDFDFD"/>
                        </Trigger>
                        <Trigger Property="IsPressed" Value="true">
                            <Setter TargetName="PART_HeaderGripper" Property="Visibility" Value="Hidden"/>
                            <Setter TargetName="HeaderContent" Property="Margin" Value="1,1,0,0"/>
                            <Setter Property="Background" Value="#FDFDFD"/>
                            <Setter Property="BorderBrush" Value="#FDFDFD"/>
                        </Trigger>
                        <Trigger Property="Height" Value="Auto">
                            <Setter Property="MinHeight" Value="20"/>
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="false">
                            <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
                        </Trigger>
                    </ControlTemplate.Triggers>-->
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Style.Triggers>
            <Trigger Property="Role" Value="Floating">
                <Setter Property="Opacity" Value="0.7"/>
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type GridViewColumnHeader}">
                            <Canvas Name="PART_FloatingHeaderCanvas" />
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Trigger>
            <Trigger Property="Role" Value="Padding">
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type GridViewColumnHeader}">
                            <Grid Background="{TemplateBinding Background}" SnapsToDevicePixels="true">
                                <Border BorderThickness="{TemplateBinding BorderThickness}"
                                        BorderBrush="{TemplateBinding BorderBrush}"
                                        Padding="{TemplateBinding Padding}" 
                                        Margin="1,0,1,0"/>
                            </Grid>
                            <ControlTemplate.Triggers>
                                <Trigger Property="Height" Value="Auto">
                                    <Setter Property="MinHeight" Value="20"/>
                                </Trigger>
                            </ControlTemplate.Triggers>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Trigger>
        </Style.Triggers>
    </Style>
    
    <Style x:Key="CleanButton" TargetType="{x:Type Button}">
        <Setter Property="FontFamily" Value="Segoe UI"/>        
        <Setter Property="FontSize" Value="{StaticResource NormalFontSize}"/>
        <Setter Property="Foreground" Value="{StaticResource LinkBrush}"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Button}">
                    <ContentPresenter Content="{TemplateBinding Content}"/>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    

    <Style TargetType="{x:Type SF_WpfUtils:DockWindowContainer}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type SF_WpfUtils:DockWindowContainer}">
                    <ScrollViewer
                            HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
                            x:Name="windowScrollViewer_PART"
                            VerticalScrollBarVisibility="Disabled" HorizontalScrollBarVisibility="Hidden">
                        <Grid x:Name="contentGrid_PART">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="*"/>
                            </Grid.ColumnDefinitions>
                            <ContentPresenter
                                        Grid.Column="0"
                                        Content="{TemplateBinding Content}"/>
                            <SF_WpfUtils:ScrollViewerOffsetMediator
                                    x:Name="Mediator_PART"            
                                    ScrollViewer="{Binding ElementName=windowScrollViewer_PART}"/>
                        </Grid>
                    </ScrollViewer>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>


    



</ResourceDictionary>